3.5.37 \(\int \sec ^3(c+d x) (a+b \tan ^2(c+d x))^2 \, dx\) [437]

Optimal. Leaf size=128 \[ \frac {\left (8 a^2-4 a b+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac {\left (8 a^2-4 a b+b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {(8 a-3 b) b \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) \left (a-(a-b) \sin ^2(c+d x)\right ) \tan (c+d x)}{6 d} \]

[Out]

1/16*(8*a^2-4*a*b+b^2)*arctanh(sin(d*x+c))/d+1/16*(8*a^2-4*a*b+b^2)*sec(d*x+c)*tan(d*x+c)/d+1/24*(8*a-3*b)*b*s
ec(d*x+c)^3*tan(d*x+c)/d+1/6*b*sec(d*x+c)^5*(a-(a-b)*sin(d*x+c)^2)*tan(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 128, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.217, Rules used = {3757, 424, 393, 205, 212} \begin {gather*} \frac {\left (8 a^2-4 a b+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac {\left (8 a^2-4 a b+b^2\right ) \tan (c+d x) \sec (c+d x)}{16 d}+\frac {b (8 a-3 b) \tan (c+d x) \sec ^3(c+d x)}{24 d}+\frac {b \tan (c+d x) \sec ^5(c+d x) \left (a-(a-b) \sin ^2(c+d x)\right )}{6 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^3*(a + b*Tan[c + d*x]^2)^2,x]

[Out]

((8*a^2 - 4*a*b + b^2)*ArcTanh[Sin[c + d*x]])/(16*d) + ((8*a^2 - 4*a*b + b^2)*Sec[c + d*x]*Tan[c + d*x])/(16*d
) + ((8*a - 3*b)*b*Sec[c + d*x]^3*Tan[c + d*x])/(24*d) + (b*Sec[c + d*x]^5*(a - (a - b)*Sin[c + d*x]^2)*Tan[c
+ d*x])/(6*d)

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 393

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[(-(b*c - a*d))*x*((a + b*x^n)^(p
 + 1)/(a*b*n*(p + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x]
 /; FreeQ[{a, b, c, d, n, p}, x] && NeQ[b*c - a*d, 0] && (LtQ[p, -1] || ILtQ[1/n + p, 0])

Rule 424

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[(a*d - c*b)*x*(a + b*x^n)^(
p + 1)*((c + d*x^n)^(q - 1)/(a*b*n*(p + 1))), x] - Dist[1/(a*b*n*(p + 1)), Int[(a + b*x^n)^(p + 1)*(c + d*x^n)
^(q - 2)*Simp[c*(a*d - c*b*(n*(p + 1) + 1)) + d*(a*d*(n*(q - 1) + 1) - b*c*(n*(p + q) + 1))*x^n, x], x], x] /;
 FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, n, p, q
, x]

Rule 3757

Int[sec[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_.), x_Symbol] :> With[{ff = F
reeFactors[Sin[e + f*x], x]}, Dist[ff/f, Subst[Int[ExpandToSum[b*(ff*x)^n + a*(1 - ff^2*x^2)^(n/2), x]^p/(1 -
ff^2*x^2)^((m + n*p + 1)/2), x], x, Sin[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n/2] && IntegerQ[p]

Rubi steps

\begin {align*} \int \sec ^3(c+d x) \left (a+b \tan ^2(c+d x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {\left (a-(a-b) x^2\right )^2}{\left (1-x^2\right )^4} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b \sec ^5(c+d x) \left (a-(a-b) \sin ^2(c+d x)\right ) \tan (c+d x)}{6 d}-\frac {\text {Subst}\left (\int \frac {-a (6 a-b)+3 (a-b) (2 a-b) x^2}{\left (1-x^2\right )^3} \, dx,x,\sin (c+d x)\right )}{6 d}\\ &=\frac {(8 a-3 b) b \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) \left (a-(a-b) \sin ^2(c+d x)\right ) \tan (c+d x)}{6 d}+\frac {\left (8 a^2-4 a b+b^2\right ) \text {Subst}\left (\int \frac {1}{\left (1-x^2\right )^2} \, dx,x,\sin (c+d x)\right )}{8 d}\\ &=\frac {\left (8 a^2-4 a b+b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {(8 a-3 b) b \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) \left (a-(a-b) \sin ^2(c+d x)\right ) \tan (c+d x)}{6 d}+\frac {\left (8 a^2-4 a b+b^2\right ) \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{16 d}\\ &=\frac {\left (8 a^2-4 a b+b^2\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac {\left (8 a^2-4 a b+b^2\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac {(8 a-3 b) b \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac {b \sec ^5(c+d x) \left (a-(a-b) \sin ^2(c+d x)\right ) \tan (c+d x)}{6 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
time = 7.42, size = 875, normalized size = 6.84 \begin {gather*} \frac {\sin (c+d x) \left (65625 a^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right )-36855 a^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^2(c+d x)-91875 a (a-b) \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^2(c+d x)+1680 a^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^4(c+d x)+54180 a (a-b) \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^4(c+d x)+32970 (a-b)^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^4(c+d x)-1365 a (a-b) \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^6(c+d x)-19845 (a-b)^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^6(c+d x)+525 (a-b)^2 \tanh ^{-1}\left (\sqrt {\sin ^2(c+d x)}\right ) \sin ^8(c+d x)-65625 a^2 \sqrt {\sin ^2(c+d x)}-23555 a (a-b) \sin ^4(c+d x) \sqrt {\sin ^2(c+d x)}-32970 (a-b)^2 \sin ^4(c+d x) \sqrt {\sin ^2(c+d x)}+8855 (a-b)^2 \sin ^6(c+d x) \sqrt {\sin ^2(c+d x)}+620 a^2 \, _4F_3\left (\frac {3}{2},2,2,2;1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^6(c+d x) \sqrt {\sin ^2(c+d x)}+160 a^2 \, _5F_4\left (\frac {3}{2},2,2,2,2;1,1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^6(c+d x) \sqrt {\sin ^2(c+d x)}+16 a^2 \, _6F_5\left (\frac {3}{2},2,2,2,2,2;1,1,1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^6(c+d x) \sqrt {\sin ^2(c+d x)}-968 a (a-b) \, _4F_3\left (\frac {3}{2},2,2,2;1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^8(c+d x) \sqrt {\sin ^2(c+d x)}-288 a (a-b) \, _5F_4\left (\frac {3}{2},2,2,2,2;1,1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^8(c+d x) \sqrt {\sin ^2(c+d x)}-32 a (a-b) \, _6F_5\left (\frac {3}{2},2,2,2,2,2;1,1,1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^8(c+d x) \sqrt {\sin ^2(c+d x)}+380 (a-b)^2 \, _4F_3\left (\frac {3}{2},2,2,2;1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^{10}(c+d x) \sqrt {\sin ^2(c+d x)}+128 (a-b)^2 \, _5F_4\left (\frac {3}{2},2,2,2,2;1,1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^{10}(c+d x) \sqrt {\sin ^2(c+d x)}+16 (a-b)^2 \, _6F_5\left (\frac {3}{2},2,2,2,2,2;1,1,1,1,\frac {9}{2};\sin ^2(c+d x)\right ) \sin ^{10}(c+d x) \sqrt {\sin ^2(c+d x)}+14980 a^2 \sin ^2(c+d x)^{3/2}+91875 a (a-b) \sin ^2(c+d x)^{3/2}\right )}{2520 d \sin ^2(c+d x)^{5/2}} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Sec[c + d*x]^3*(a + b*Tan[c + d*x]^2)^2,x]

[Out]

(Sin[c + d*x]*(65625*a^2*ArcTanh[Sqrt[Sin[c + d*x]^2]] - 36855*a^2*ArcTanh[Sqrt[Sin[c + d*x]^2]]*Sin[c + d*x]^
2 - 91875*a*(a - b)*ArcTanh[Sqrt[Sin[c + d*x]^2]]*Sin[c + d*x]^2 + 1680*a^2*ArcTanh[Sqrt[Sin[c + d*x]^2]]*Sin[
c + d*x]^4 + 54180*a*(a - b)*ArcTanh[Sqrt[Sin[c + d*x]^2]]*Sin[c + d*x]^4 + 32970*(a - b)^2*ArcTanh[Sqrt[Sin[c
 + d*x]^2]]*Sin[c + d*x]^4 - 1365*a*(a - b)*ArcTanh[Sqrt[Sin[c + d*x]^2]]*Sin[c + d*x]^6 - 19845*(a - b)^2*Arc
Tanh[Sqrt[Sin[c + d*x]^2]]*Sin[c + d*x]^6 + 525*(a - b)^2*ArcTanh[Sqrt[Sin[c + d*x]^2]]*Sin[c + d*x]^8 - 65625
*a^2*Sqrt[Sin[c + d*x]^2] - 23555*a*(a - b)*Sin[c + d*x]^4*Sqrt[Sin[c + d*x]^2] - 32970*(a - b)^2*Sin[c + d*x]
^4*Sqrt[Sin[c + d*x]^2] + 8855*(a - b)^2*Sin[c + d*x]^6*Sqrt[Sin[c + d*x]^2] + 620*a^2*HypergeometricPFQ[{3/2,
 2, 2, 2}, {1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^6*Sqrt[Sin[c + d*x]^2] + 160*a^2*HypergeometricPFQ[{3/2,
2, 2, 2, 2}, {1, 1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^6*Sqrt[Sin[c + d*x]^2] + 16*a^2*HypergeometricPFQ[{3
/2, 2, 2, 2, 2, 2}, {1, 1, 1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^6*Sqrt[Sin[c + d*x]^2] - 968*a*(a - b)*Hyp
ergeometricPFQ[{3/2, 2, 2, 2}, {1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^8*Sqrt[Sin[c + d*x]^2] - 288*a*(a - b
)*HypergeometricPFQ[{3/2, 2, 2, 2, 2}, {1, 1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^8*Sqrt[Sin[c + d*x]^2] - 3
2*a*(a - b)*HypergeometricPFQ[{3/2, 2, 2, 2, 2, 2}, {1, 1, 1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^8*Sqrt[Sin
[c + d*x]^2] + 380*(a - b)^2*HypergeometricPFQ[{3/2, 2, 2, 2}, {1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c + d*x]^10*Sq
rt[Sin[c + d*x]^2] + 128*(a - b)^2*HypergeometricPFQ[{3/2, 2, 2, 2, 2}, {1, 1, 1, 9/2}, Sin[c + d*x]^2]*Sin[c
+ d*x]^10*Sqrt[Sin[c + d*x]^2] + 16*(a - b)^2*HypergeometricPFQ[{3/2, 2, 2, 2, 2, 2}, {1, 1, 1, 1, 9/2}, Sin[c
 + d*x]^2]*Sin[c + d*x]^10*Sqrt[Sin[c + d*x]^2] + 14980*a^2*(Sin[c + d*x]^2)^(3/2) + 91875*a*(a - b)*(Sin[c +
d*x]^2)^(3/2)))/(2520*d*(Sin[c + d*x]^2)^(5/2))

________________________________________________________________________________________

Maple [A]
time = 0.32, size = 199, normalized size = 1.55

method result size
derivativedivides \(\frac {b^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{5}\left (d x +c \right )}{24 \cos \left (d x +c \right )^{4}}-\frac {\sin ^{5}\left (d x +c \right )}{48 \cos \left (d x +c \right )^{2}}-\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{48}-\frac {\sin \left (d x +c \right )}{16}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )+2 a b \left (\frac {\sin ^{3}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(199\)
default \(\frac {b^{2} \left (\frac {\sin ^{5}\left (d x +c \right )}{6 \cos \left (d x +c \right )^{6}}+\frac {\sin ^{5}\left (d x +c \right )}{24 \cos \left (d x +c \right )^{4}}-\frac {\sin ^{5}\left (d x +c \right )}{48 \cos \left (d x +c \right )^{2}}-\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{48}-\frac {\sin \left (d x +c \right )}{16}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{16}\right )+2 a b \left (\frac {\sin ^{3}\left (d x +c \right )}{4 \cos \left (d x +c \right )^{4}}+\frac {\sin ^{3}\left (d x +c \right )}{8 \cos \left (d x +c \right )^{2}}+\frac {\sin \left (d x +c \right )}{8}-\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+a^{2} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )}{d}\) \(199\)
risch \(-\frac {i \left (24 a^{2} {\mathrm e}^{11 i \left (d x +c \right )}-12 a b \,{\mathrm e}^{11 i \left (d x +c \right )}+3 b^{2} {\mathrm e}^{11 i \left (d x +c \right )}+72 a^{2} {\mathrm e}^{9 i \left (d x +c \right )}+60 a b \,{\mathrm e}^{9 i \left (d x +c \right )}-47 b^{2} {\mathrm e}^{9 i \left (d x +c \right )}+48 a^{2} {\mathrm e}^{7 i \left (d x +c \right )}+72 a b \,{\mathrm e}^{7 i \left (d x +c \right )}+78 b^{2} {\mathrm e}^{7 i \left (d x +c \right )}-48 a^{2} {\mathrm e}^{5 i \left (d x +c \right )}-72 a b \,{\mathrm e}^{5 i \left (d x +c \right )}-78 b^{2} {\mathrm e}^{5 i \left (d x +c \right )}-72 a^{2} {\mathrm e}^{3 i \left (d x +c \right )}-60 a b \,{\mathrm e}^{3 i \left (d x +c \right )}+47 b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-24 a^{2} {\mathrm e}^{i \left (d x +c \right )}+12 a b \,{\mathrm e}^{i \left (d x +c \right )}-3 b^{2} {\mathrm e}^{i \left (d x +c \right )}\right )}{24 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{6}}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a b}{4 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) b^{2}}{16 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a b}{4 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) b^{2}}{16 d}\) \(392\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(b^2*(1/6*sin(d*x+c)^5/cos(d*x+c)^6+1/24*sin(d*x+c)^5/cos(d*x+c)^4-1/48*sin(d*x+c)^5/cos(d*x+c)^2-1/48*sin
(d*x+c)^3-1/16*sin(d*x+c)+1/16*ln(sec(d*x+c)+tan(d*x+c)))+2*a*b*(1/4*sin(d*x+c)^3/cos(d*x+c)^4+1/8*sin(d*x+c)^
3/cos(d*x+c)^2+1/8*sin(d*x+c)-1/8*ln(sec(d*x+c)+tan(d*x+c)))+a^2*(1/2*sec(d*x+c)*tan(d*x+c)+1/2*ln(sec(d*x+c)+
tan(d*x+c))))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 156, normalized size = 1.22 \begin {gather*} \frac {3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \log \left (\sin \left (d x + c\right ) - 1\right ) - \frac {2 \, {\left (3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \sin \left (d x + c\right )^{5} - 8 \, {\left (6 \, a^{2} - b^{2}\right )} \sin \left (d x + c\right )^{3} + 3 \, {\left (8 \, a^{2} + 4 \, a b - b^{2}\right )} \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1}}{96 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x, algorithm="maxima")

[Out]

1/96*(3*(8*a^2 - 4*a*b + b^2)*log(sin(d*x + c) + 1) - 3*(8*a^2 - 4*a*b + b^2)*log(sin(d*x + c) - 1) - 2*(3*(8*
a^2 - 4*a*b + b^2)*sin(d*x + c)^5 - 8*(6*a^2 - b^2)*sin(d*x + c)^3 + 3*(8*a^2 + 4*a*b - b^2)*sin(d*x + c))/(si
n(d*x + c)^6 - 3*sin(d*x + c)^4 + 3*sin(d*x + c)^2 - 1))/d

________________________________________________________________________________________

Fricas [A]
time = 3.29, size = 137, normalized size = 1.07 \begin {gather*} \frac {3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \cos \left (d x + c\right )^{4} + 2 \, {\left (12 \, a b - 7 \, b^{2}\right )} \cos \left (d x + c\right )^{2} + 8 \, b^{2}\right )} \sin \left (d x + c\right )}{96 \, d \cos \left (d x + c\right )^{6}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x, algorithm="fricas")

[Out]

1/96*(3*(8*a^2 - 4*a*b + b^2)*cos(d*x + c)^6*log(sin(d*x + c) + 1) - 3*(8*a^2 - 4*a*b + b^2)*cos(d*x + c)^6*lo
g(-sin(d*x + c) + 1) + 2*(3*(8*a^2 - 4*a*b + b^2)*cos(d*x + c)^4 + 2*(12*a*b - 7*b^2)*cos(d*x + c)^2 + 8*b^2)*
sin(d*x + c))/(d*cos(d*x + c)^6)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan ^{2}{\left (c + d x \right )}\right )^{2} \sec ^{3}{\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**3*(a+b*tan(d*x+c)**2)**2,x)

[Out]

Integral((a + b*tan(c + d*x)**2)**2*sec(c + d*x)**3, x)

________________________________________________________________________________________

Giac [A]
time = 0.78, size = 167, normalized size = 1.30 \begin {gather*} \frac {3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) + 1 \right |}\right ) - 3 \, {\left (8 \, a^{2} - 4 \, a b + b^{2}\right )} \log \left ({\left | \sin \left (d x + c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (24 \, a^{2} \sin \left (d x + c\right )^{5} - 12 \, a b \sin \left (d x + c\right )^{5} + 3 \, b^{2} \sin \left (d x + c\right )^{5} - 48 \, a^{2} \sin \left (d x + c\right )^{3} + 8 \, b^{2} \sin \left (d x + c\right )^{3} + 24 \, a^{2} \sin \left (d x + c\right ) + 12 \, a b \sin \left (d x + c\right ) - 3 \, b^{2} \sin \left (d x + c\right )\right )}}{{\left (\sin \left (d x + c\right )^{2} - 1\right )}^{3}}}{96 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3*(a+b*tan(d*x+c)^2)^2,x, algorithm="giac")

[Out]

1/96*(3*(8*a^2 - 4*a*b + b^2)*log(abs(sin(d*x + c) + 1)) - 3*(8*a^2 - 4*a*b + b^2)*log(abs(sin(d*x + c) - 1))
- 2*(24*a^2*sin(d*x + c)^5 - 12*a*b*sin(d*x + c)^5 + 3*b^2*sin(d*x + c)^5 - 48*a^2*sin(d*x + c)^3 + 8*b^2*sin(
d*x + c)^3 + 24*a^2*sin(d*x + c) + 12*a*b*sin(d*x + c) - 3*b^2*sin(d*x + c))/(sin(d*x + c)^2 - 1)^3)/d

________________________________________________________________________________________

Mupad [B]
time = 15.64, size = 269, normalized size = 2.10 \begin {gather*} \frac {\left (a^2+\frac {a\,b}{2}-\frac {b^2}{8}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{11}+\left (-3\,a^2+\frac {5\,a\,b}{2}+\frac {17\,b^2}{24}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^9+\left (2\,a^2-3\,a\,b+\frac {19\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^7+\left (2\,a^2-3\,a\,b+\frac {19\,b^2}{4}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5+\left (-3\,a^2+\frac {5\,a\,b}{2}+\frac {17\,b^2}{24}\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3+\left (a^2+\frac {a\,b}{2}-\frac {b^2}{8}\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{12}-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8-20\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+15\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4-6\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}+\frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )\,\left (a^2-\frac {a\,b}{2}+\frac {b^2}{8}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*tan(c + d*x)^2)^2/cos(c + d*x)^3,x)

[Out]

(tan(c/2 + (d*x)/2)^5*(2*a^2 - 3*a*b + (19*b^2)/4) + tan(c/2 + (d*x)/2)^7*(2*a^2 - 3*a*b + (19*b^2)/4) + tan(c
/2 + (d*x)/2)^3*((5*a*b)/2 - 3*a^2 + (17*b^2)/24) + tan(c/2 + (d*x)/2)^9*((5*a*b)/2 - 3*a^2 + (17*b^2)/24) + t
an(c/2 + (d*x)/2)*((a*b)/2 + a^2 - b^2/8) + tan(c/2 + (d*x)/2)^11*((a*b)/2 + a^2 - b^2/8))/(d*(15*tan(c/2 + (d
*x)/2)^4 - 6*tan(c/2 + (d*x)/2)^2 - 20*tan(c/2 + (d*x)/2)^6 + 15*tan(c/2 + (d*x)/2)^8 - 6*tan(c/2 + (d*x)/2)^1
0 + tan(c/2 + (d*x)/2)^12 + 1)) + (atanh(tan(c/2 + (d*x)/2))*(a^2 - (a*b)/2 + b^2/8))/d

________________________________________________________________________________________